<?php



/* Require once the code which enables JSON to any version of PHP. 
 * Based on the package Services_JSON	: http://pear.php.net/pepr/pepr-proposal-show.php?id=198
 * Edited by Ikkerens					: http://walotech.com/jsonsource.php
 */
require_once("JSON_services.php");

$link = mysql_pconnect("localhost", "root", "usbw") or die("Could not connect");
mysql_select_db("test") or die("Could not select database");
 
$arr = array();
$rs = mysql_query("
	SELECT id, url, text 
	FROM data
");
 
while($obj = mysql_fetch_object($rs)) 
{
	$arr[] = $obj;
}
 
print('(' . json_encode($arr) . ')'); 



?>